﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Demo
{
    class User
    {
        private string name;
        private string password;
        private string section;

        public void Test()
        {

            Console.WriteLine("用户的姓名是{0}，用户密码是{1}，用户的部门是{2}", name, password, section);
        }


        public string Name
        {
            get { return this.name; }
            set
            {
                if (value == "帅哥")
                {
                    Console.WriteLine("你不是");
                    Console.WriteLine("请重新输入");
                    this.name = Console.ReadLine();
                }
                else { this.name = value; }

            }
        }
        public String Password
        {
            get { return this.password; }
            set { this.password = value; }
        }
        public String Section
        {
            get { return this.section; }
            set { this.section = value; }
        }
    }
}
